/**
 *
 */
package com.angel.mocks.io.rowProcessorCommands;

import java.text.DateFormat;

import com.angel.io.exceptions.InvalidRowDataException;
import com.angel.io.processors.commands.exports.ExportRowProcessorCommand;
import com.angel.io.type.rows.ExportRowFile;
import com.angel.io.type.rows.impl.HeaderRowFile;
import com.angel.mocks.io.CalendarTask;

/**
 * @author William
 *
 */
public class CalendarTaskRowProcessorCommand implements ExportRowProcessorCommand{

	public static final String DESCRIPTION_COLUMN = "description";
	public static final String MODERATOR_NAME_COLUMN = "moderatorName";
	public static final String SUBJECT_COLUMN = "subject";
	public static final String BEGIN_COLUMN = "begin";
	public static final String END_COLUMN = "end";

	public void checkHeader(HeaderRowFile headerRowFile) throws InvalidRowDataException {

	}

	public void processRow(ExportRowFile exportRowFile, Object toExport, HeaderRowFile headerRowFile) throws InvalidRowDataException {
		CalendarTask calendarTaskToExport = (CalendarTask) toExport;
		exportRowFile.addStringValue(calendarTaskToExport.getDescription(), headerRowFile.getColumnPosition("DESCRIPTION:"));
		//exportRowFile.addStringValue(calendarTaskToExport.getSubject(), headerRowFile.getColumnPosition(OutlookFileColumnsFactory.OUTLOOK_SUMMARY_COLUMN_6));
		exportRowFile.addDateValue(calendarTaskToExport.getBegin(), DateFormat.getDateInstance(DateFormat.MEDIUM), headerRowFile.getColumnPosition("DTSTART:"));
		exportRowFile.addDateValue(calendarTaskToExport.getBegin(), DateFormat.getDateInstance(DateFormat.MEDIUM), headerRowFile.getColumnPosition("DTSTAMP:"));
		exportRowFile.addDateValue(calendarTaskToExport.getEnd(), DateFormat.getDateInstance(DateFormat.MEDIUM), headerRowFile.getColumnPosition("DTEND:"));
	}
}
